package com.dyh.quickdemo.demos.lbdand;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/*
@Author=Joey Wheeler
@Date=2020/12/4 17:12
*/
public class CircuitBreakerCenter {
    public static final  Map<String,CircuitBreaker> breakerMap = new ConcurrentHashMap<>();

    public static CircuitBreaker find(String resourceName){
        return breakerMap.get(resourceName);
    }

    public static void regist(CircuitBreaker breaker){
        breakerMap.putIfAbsent(breaker.resourceName,breaker);
    }
}
